#!/bin/bash
# Launcher: runs the engine with everything kept inside this folder (Mac, Linux, and Git Bash on Windows).
DIR="$(cd "$(dirname "$0")" && pwd)"
PY="$DIR/.venv/bin/python"
case "$(uname -s)" in
  MINGW*|MSYS*|CYGWIN*)  # Windows: Python wants C:/... paths and its own arguments untouched
    DIR="$(cygpath -m "$DIR")"; PY="$DIR/.venv/Scripts/python.exe"
    export MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' ;;
esac
export CONTENT_HOME="$DIR/data" CONTENT_OUT="$DIR/Έτοιμα" CONTENT_INBOX="$DIR/Τα στοιχεία μου"
export PYTHONUTF8=1 PYTHONIOENCODING=utf-8
if [ ! -x "$PY" ] && [ ! -f "$PY" ]; then
  echo "Το engine δεν έχει στηθεί ακόμα. Τρέξε: bash install.sh" >&2
  exit 2
fi
exec "$PY" "$DIR/engine/content.py" "$@"
